import { PageContainer } from "@/components/PageContainer";
import HomePageClient from "./HomePageClient";
import { notesOptions } from '@/shared/api/notes/useNotes';
import { queryClientUtils } from '@/modules/application/utils/queryClientUtils';
import {weatherOptions} from "@/shared/api/weather";

export default async function HomePage() {
    const queryClient = queryClientUtils.getQueryClient();

    // Prefetch notes data
    await queryClient.prefetchQuery(notesOptions());

    // Prefetch weather data for Henan Luohe
    await queryClient.prefetchQuery(weatherOptions({ city: '河南漯河' }));

    return (
        <PageContainer queryClient={queryClient}>
            <HomePageClient />
        </PageContainer>
    );
};
